#include "pch.h"

#include <string>
#include <iostream>
#include <comdef.h>

struct Shoe {
    int id;
    BSTR color;
    double size;
    BSTR brand;
    bool sold = false;

    void buy() {
        std::cout << "Successfully purchased the ";
        std::wcout << color;
        std::wcout << " " << brand;
        std::cout << " shoe.";
        sold = true;
    }
};

extern "C" _declspec(dllexport) Shoe CreateShoe()
{
    Shoe s;
    s.brand = SysAllocString(L"Hongxin");
    s.size = 40;
    s.id = 100;
    s.color = SysAllocString(L"blue");
    return s;
}

extern "C" _declspec(dllexport) void BuyShoe(Shoe * shoe)
{
    shoe->buy();
}